package com.jf.hotelreservation.demos.controller;

import com.jf.hotelreservation.demos.bean.vo.HotelVo;
import com.jf.hotelreservation.demos.service.impl.HotelServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/hotel")
public class HotelController {

    @Autowired
    private HotelServiceImpl hotelService;

    @PostMapping("/addHotel")
    public String addHotel(@RequestBody HotelVo hotelVo){
        return hotelService.addHotel(hotelVo);
    }

    @GetMapping("/queryAll")
    public String queryAll(int currentPage,int pageSize){
        return hotelService.queryAllHotel(currentPage,pageSize);
    }

    @GetMapping("/queryById")
    public String queryById(int id){
        return hotelService.queryById(id);
    }

    @GetMapping("/getAllByRoom")
    public String getAllByRoom(){
        return hotelService.queryByRoom();
    }
}
